A cluster is formed by two or more computers, and each computer is referred to as a node in the cluster. Because a network is faulty (for example, a switch in the network is faulty), a cluster may be split into two or more node groups, and this phenomenon is called brain split. After the brain split occurs in the cluster, each node group in the split two or more node groups cannot detect existence of another node group by using heart beat information or lease information, and consequently, the node group may consider that nodes in the another node group are faulty. In this way, nodes in the node groups may initiate access to a shared storage resource (for example, a storage disk) within a same period, which may cause a data access error. In this case, cluster management software generally arbitrates, by using a particular algorithm, which node group wins and continues works of the original cluster. Nodes in a node group that fails need to be restarted and perform an operation of re-joining the cluster.
In the prior art, the following manner is used to resolve the foregoing problem: an algorithm that quorum nodes vote is used. That is, some nodes are selected from all nodes in a cluster and are set as quorum nodes. When brain split occurs, a quantity of quorum nodes surviving in the cluster is N. When the brain split occurs and the original cluster is split into two node groups, a node in a node group may determine connectivity between the node and another node by detecting heart beat information or lease information of the another node. It is determined according to the detection that a node group including n quorum nodes forms a first node group and another node group including N−n quorum nodes forms a second node group. Each quorum node in the two node groups can detect a quantity of quorum nodes in the node group of the quorum node, and when detecting that the quantity of quorum nodes in the node group of the quorum node exceeds Round(N/2)+1 (Round(*) is a rounding function), considers that the node group of the quorum node is a main part (that is, a master node group determined through arbitration after the brain split) of the cluster after the brain split occurs. The node group continues works of the cluster. When a node in the other node group detects that a quantity of quorum nodes in the node group of the node is less than Round(N/2)+1, the node performs node restart, and re-joins a cluster formed by the node group that continues to work.
In a process of implementing the present disclosure, it is found that the prior art has the following problem: when a cluster is split into three or more node groups, because a quantity of quorum nodes in each node group cannot exceed Round(N/2)+1 (N is a total quantity of quorum nodes surviving in the cluster and N is a positive integer), a master node group cannot be determined through arbitration to continue works of the cluster.